//
//  LBCycleScrollView.h
//  PagedScrollView
//
//  Created by  on 14-1-23.
//  Copyright (c) 2014年 Apple Inc. All rights reserved.
//

#import <UIKit/UIKit.h>

@class LBCycleScrollView;
@protocol LBCycleScrollViewDelegate <NSObject>

- (void)viewDidShow:(LBCycleScrollView *)LBCycleScrollView index:(NSInteger)index;
- (UIView *)viewAtIndex:(LBCycleScrollView *)LBCycleScrollView index:(NSInteger)index;

@end

@interface LBCycleScrollView : UIView

@property (nonatomic , strong) NSTimer *animationTimer;
@property (nonatomic , readonly) UIScrollView *scrollView;
@property (nonatomic , strong, readonly) UIView *currentView;   // 保留当前显示的视图
/**
 *  初始化
 *
 *  @param frame             frame
 *  @param animationDuration 自动滚动的间隔时长。如果<=0，不自动滚动。
 *
 *  @return instance
 */
- (id)initWithFrame:(CGRect)frame animationDuration:(NSTimeInterval)animationDuration;



/**
 数据源：获取第pageIndex个位置的contentView
 **/
//@property (nonatomic , copy) UIView *(^fetchContentViewAtIndex)(NSInteger pageIndex);
//
//@property (nonatomic , copy) void(^viewDidShow)(NSInteger pageIndex);

@property (nonatomic , assign) NSInteger currentPageIndex;
@property (nonatomic , assign) id<LBCycleScrollViewDelegate> delegate;
/**
 数据源：获取总的page个数
 **/
@property (nonatomic , assign) NSInteger totalPagesCount;

@end
